package com.ryan.mdp.exception;

import javax.jms.JMSException;

public class MdpException extends JMSException {
    private static final long serialVersionUID = 1L;
    private final String errorCode;

    public MdpException(String errorCode, Object... args) {
        super("ErrorCode:" + errorCode + ", " + MdpMessages.getMessage(errorCode, args));
        this.errorCode = errorCode;
    }

    public MdpException(String errorCode, Exception ex, Object... args) {
        this(errorCode, args);
        setLinkedException(ex);
    }

    public String getErrorCode() {
        return errorCode;
    }
}
